<?php



namespace App\Services\Member\Models;


use App\Services\Business\Models\Combo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use App\Services\Company\Models\Company;

class Team extends Model
{
    use Notifiable, HasFactory;

    protected $table = 'team';



    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id','name', 'user_count','company_id','course_name'
    ];

    public  function  users()
    {
        return $this->belongsToMany(User::class, 'user_team', 'team_id', 'user_id')->withTimestamps();
    }

    public function team()
    {
        return $this->belongsTo(Team::class, 'team_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }












}
